'''
Created on 05/05/2010

@author: emlyn
'''
from google.appengine.ext import db
from PSStudent import PSStudent
from PSTeachingPeriod import PSTeachingPeriod
from DataClass import SiteUser

class PSInvoice(db.Model):
    user = db.ReferenceProperty(SiteUser)
    psstudent = db.ReferenceProperty(PSStudent)
    psteachingperiod = db.ReferenceProperty(PSTeachingPeriod)
    dateissued = db.DateProperty()
    datedue = db.DateProperty()
    status = db.IntegerProperty() # This is an index into PSLesson.GetStatuses()
    notes = db.StringProperty(multiline=True)
# This is an index into PSLesson.GetStatuses()    
    def GetStatuses(cls):
        return ['Generated', 'Issued', 'Payed', 'Cancelled']
    GetStatuses = classmethod(GetStatuses)
    
